/*
 Navicat Premium Dump SQL

 Source Server         : 云服务器
 Source Server Type    : MySQL
 Source Server Version : 80039 (8.0.39)
 Source Host           : 107.151.248.212:3306
 Source Schema         : crop

 Target Server Type    : MySQL
 Target Server Version : 80039 (8.0.39)
 File Encoding         : 65001

 Date: 23/01/2025 16:25:40
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for processing_batch
-- ----------------------------
DROP TABLE IF EXISTS `processing_batch`;
CREATE TABLE `processing_batch` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `processor_id` bigint NOT NULL COMMENT '加工企业ID',
  `batch_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '批次号',
  `product_id` bigint DEFAULT NULL COMMENT '产品ID',
  `processing_date` date DEFAULT NULL COMMENT '加工日期',
  `status` tinyint DEFAULT '0' COMMENT '状态：0-进行中 1-已完成',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_batch_no` (`batch_no`) USING BTREE,
  KEY `idx_processor` (`processor_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='加工批次表';

-- ----------------------------
-- Records of processing_batch
-- ----------------------------
BEGIN;
INSERT INTO `processing_batch` (`id`, `processor_id`, `batch_no`, `product_id`, `processing_date`, `status`, `create_time`, `update_time`, `deleted`) VALUES (1, 1, '1', 2, '2025-01-08', 0, '2025-01-21 16:47:36', '2025-01-21 17:17:48', 0);
INSERT INTO `processing_batch` (`id`, `processor_id`, `batch_no`, `product_id`, `processing_date`, `status`, `create_time`, `update_time`, `deleted`) VALUES (6, 1, '54', 1, '2025-01-21', 0, '2025-01-21 17:09:55', '2025-01-21 18:16:52', 0);
INSERT INTO `processing_batch` (`id`, `processor_id`, `batch_no`, `product_id`, `processing_date`, `status`, `create_time`, `update_time`, `deleted`) VALUES (7, 1, '2', 3, '2025-01-20', 1, '2025-01-21 17:18:17', '2025-01-21 17:59:02', 0);
COMMIT;

-- ----------------------------
-- Table structure for processor
-- ----------------------------
DROP TABLE IF EXISTS `processor`;
CREATE TABLE `processor` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '企业名称',
  `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '地址',
  `license_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '营业执照号',
  `license_image` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '营业执照图片',
  `processing_license` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '加工许可证',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  `phone` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='加工企业表';

-- ----------------------------
-- Records of processor
-- ----------------------------
BEGIN;
INSERT INTO `processor` (`id`, `name`, `address`, `license_no`, `license_image`, `processing_license`, `create_time`, `update_time`, `deleted`, `phone`) VALUES (1, 'lujie', '11', '11', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/2ad8ef6a576c45699ef6f2bdccabec78_bj.JPG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T104631Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=65fceeb686ec2f20a699c2ab02977e57a673d491b8d61acfef0211ff4eef00b3', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/e1827996ac96479291121820d03af791_bj.JPG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T104633Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=0d293e011dffba2c40a01a8649785d031da120afade0ea1b103c254a9cc604b8', '2025-01-21 16:09:59', '2025-01-21 18:51:27', 0, NULL);
COMMIT;

-- ----------------------------
-- Table structure for product
-- ----------------------------
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `supplier_id` bigint NOT NULL COMMENT '供应商ID',
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '产品名称',
  `category_id` bigint DEFAULT NULL COMMENT '产品分类ID',
  `variety` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '品种',
  `specification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格',
  `cultivation_method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '种植/养殖方式',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '产品描述',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  `image_url` text,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_supplier` (`supplier_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='产品表';

-- ----------------------------
-- Records of product
-- ----------------------------
BEGIN;
INSERT INTO `product` (`id`, `supplier_id`, `name`, `category_id`, `variety`, `specification`, `cultivation_method`, `description`, `create_time`, `update_time`, `deleted`, `image_url`) VALUES (2, 4, '大米', 1, '2', '2', '2', '2', '2025-01-21 14:06:21', '2025-01-21 14:06:21', 0, 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/4b86499603ce40fe8965d414e75f6c10_%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230823184715.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T070437Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=2c9c8145952a23a6a4522cae860248b020f79506e497797004cd0fccc668ead6');
INSERT INTO `product` (`id`, `supplier_id`, `name`, `category_id`, `variety`, `specification`, `cultivation_method`, `description`, `create_time`, `update_time`, `deleted`, `image_url`) VALUES (3, 4, '面包', 2, '23', '1321', '321', '321', '2025-01-21 14:06:32', '2025-01-21 17:18:07', 0, 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/294ab4e885a94fbf9520b8014f14933d_bj.JPG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T070538Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=c5aa1b355e287b5cea8850d5c6b825cec83d2bf1d258fc984f7c8ddc56130a86');
INSERT INTO `product` (`id`, `supplier_id`, `name`, `category_id`, `variety`, `specification`, `cultivation_method`, `description`, `create_time`, `update_time`, `deleted`, `image_url`) VALUES (4, 4, '21', 1, '21', '21', '21', '21', '2025-01-21 14:35:06', '2025-01-21 14:35:06', 0, NULL);
INSERT INTO `product` (`id`, `supplier_id`, `name`, `category_id`, `variety`, `specification`, `cultivation_method`, `description`, `create_time`, `update_time`, `deleted`, `image_url`) VALUES (5, 4, '2122', 1, '212', '212', '212', '2122', '2025-01-21 14:35:22', '2025-01-21 14:35:22', 0, NULL);
INSERT INTO `product` (`id`, `supplier_id`, `name`, `category_id`, `variety`, `specification`, `cultivation_method`, `description`, `create_time`, `update_time`, `deleted`, `image_url`) VALUES (6, 4, '23321', 1, '21321', '312', '3213', '213213', '2025-01-21 14:35:31', '2025-01-21 14:35:31', 0, NULL);
INSERT INTO `product` (`id`, `supplier_id`, `name`, `category_id`, `variety`, `specification`, `cultivation_method`, `description`, `create_time`, `update_time`, `deleted`, `image_url`) VALUES (7, 4, '3213131', 4, '3123213', '3213213', '123123123', '23213', '2025-01-21 14:35:39', '2025-01-21 14:35:39', 0, NULL);
COMMIT;

-- ----------------------------
-- Table structure for product_category
-- ----------------------------
DROP TABLE IF EXISTS `product_category`;
CREATE TABLE `product_category` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分类名称',
  `sort` int DEFAULT '0' COMMENT '排序',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='产品分类表';

-- ----------------------------
-- Records of product_category
-- ----------------------------
BEGIN;
INSERT INTO `product_category` (`id`, `name`, `sort`, `create_time`, `update_time`, `deleted`) VALUES (1, '大米', 0, '2025-01-21 14:02:54', '2025-01-21 16:58:48', 0);
INSERT INTO `product_category` (`id`, `name`, `sort`, `create_time`, `update_time`, `deleted`) VALUES (2, '说i到', 1, '2025-01-21 14:25:03', '2025-01-21 14:25:03', 0);
INSERT INTO `product_category` (`id`, `name`, `sort`, `create_time`, `update_time`, `deleted`) VALUES (3, '面包', 0, '2025-01-21 14:25:22', '2025-01-21 14:25:22', 0);
INSERT INTO `product_category` (`id`, `name`, `sort`, `create_time`, `update_time`, `deleted`) VALUES (4, '1', 0, '2025-01-21 14:25:25', '2025-01-21 14:25:25', 0);
INSERT INTO `product_category` (`id`, `name`, `sort`, `create_time`, `update_time`, `deleted`) VALUES (5, '1', 0, '2025-01-21 14:25:26', '2025-01-21 14:25:26', 0);
INSERT INTO `product_category` (`id`, `name`, `sort`, `create_time`, `update_time`, `deleted`) VALUES (6, '32', 0, '2025-01-21 14:25:28', '2025-01-21 14:25:28', 0);
COMMIT;

-- ----------------------------
-- Table structure for product_record
-- ----------------------------
DROP TABLE IF EXISTS `product_record`;
CREATE TABLE `product_record` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `product_id` bigint NOT NULL COMMENT '产品ID',
  `temperature` decimal(5,2) DEFAULT NULL COMMENT '温度',
  `moisture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '水分',
  `growth_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生长情况',
  `light_condition` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '光照情况',
  `remarks` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注',
  `image_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '生长图片',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_product` (`product_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='生产记录表';

-- ----------------------------
-- Records of product_record
-- ----------------------------
BEGIN;
INSERT INTO `product_record` (`id`, `product_id`, `temperature`, `moisture`, `growth_status`, `light_condition`, `remarks`, `image_url`, `create_time`, `update_time`, `deleted`) VALUES (1, 2, 1.00, '1231', '`12', '2`', '2`1', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/10e876628d074c6db52712e3fd594b11_%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230823184715.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T075009Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=610d82e86a850f7281763afadecd4a2341ec4f46d449230efef9d1e59545d1b2', '2025-01-21 15:50:12', '2025-01-21 15:50:12', 0);
COMMIT;

-- ----------------------------
-- Table structure for qrcode
-- ----------------------------
DROP TABLE IF EXISTS `qrcode`;
CREATE TABLE `qrcode` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `batch_id` bigint NOT NULL COMMENT '批次ID',
  `code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '二维码内容',
  `encryption_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '加密参数',
  `valid_until` datetime DEFAULT NULL COMMENT '有效期',
  `scan_count` int DEFAULT '0' COMMENT '扫描次数',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-无效 1-有效',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_code` (`code`(100)) USING BTREE,
  KEY `idx_batch` (`batch_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='二维码表';

-- ----------------------------
-- Records of qrcode
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for quality_inspection
-- ----------------------------
DROP TABLE IF EXISTS `quality_inspection`;
CREATE TABLE `quality_inspection` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `batch_id` bigint NOT NULL COMMENT '批次ID',
  `inspector` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '检测人员',
  `inspection_time` datetime DEFAULT NULL COMMENT '检测时间',
  `inspection_items` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '检测项目，JSON格式。示例：\n    [\n        {\n            "item_id": 1,\n            "name": "农药残留",\n            "standard": "GB 2763-2021",\n            "method": "气相色谱法",\n            "unit": "mg/kg",\n            "limit_value": 0.1\n        },\n        {\n            "item_id": 2,\n            "name": "重金属含量",\n            "standard": "GB 2762-2017",\n            "method": "原子吸收分光光度法",\n            "unit": "mg/kg",\n            "limit_value": 0.2\n        }\n    ]',
  `results` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '检测结果，JSON格式。示例：\n    [\n        {\n            "item_id": 1,\n            "tested_value": 0.05,\n            "is_qualified": true,\n            "notes": "符合标准要求"\n        },\n        {\n            "item_id": 2,\n            "tested_value": 0.15,\n            "is_qualified": true,\n            "notes": "符合标准要求"\n        }\n    ]',
  `report_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '检测报告URL',
  `status` tinyint DEFAULT '0' COMMENT '状态：0-不合格 1-合格',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_batch` (`batch_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='质量检测记录表';

-- ----------------------------
-- Records of quality_inspection
-- ----------------------------
BEGIN;
INSERT INTO `quality_inspection` (`id`, `batch_id`, `inspector`, `inspection_time`, `inspection_items`, `results`, `report_url`, `status`, `create_time`, `update_time`, `deleted`) VALUES (1, 1, '健康检测方', '2025-01-21 09:50:19', '1', '1', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/20cfe378c55d45858b548e785850d7b2_%E8%BD%AF%E4%BB%B6%E6%B5%8B%E8%AF%95%E6%8A%80%E6%9C%AF%E7%BB%8F%E5%85%B8%E6%95%99%E7%A8%8B%20%20_%20%202%E7%89%88.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T095027Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=ffb73d314100613b701455e9e51665c115fbee837641e8a80713e394bb0cf460', 0, '2025-01-21 17:50:32', '2025-01-21 17:50:32', 0);
INSERT INTO `quality_inspection` (`id`, `batch_id`, `inspector`, `inspection_time`, `inspection_items`, `results`, `report_url`, `status`, `create_time`, `update_time`, `deleted`) VALUES (2, 1, '健康检测方', '2025-01-21 09:50:19', '1', '1', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/20cfe378c55d45858b548e785850d7b2_%E8%BD%AF%E4%BB%B6%E6%B5%8B%E8%AF%95%E6%8A%80%E6%9C%AF%E7%BB%8F%E5%85%B8%E6%95%99%E7%A8%8B%20%20_%20%202%E7%89%88.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T095027Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=ffb73d314100613b701455e9e51665c115fbee837641e8a80713e394bb0cf460', 0, '2025-01-21 17:50:32', '2025-01-21 17:57:25', 0);
INSERT INTO `quality_inspection` (`id`, `batch_id`, `inspector`, `inspection_time`, `inspection_items`, `results`, `report_url`, `status`, `create_time`, `update_time`, `deleted`) VALUES (3, 1, '健康检测方', '2025-01-21 09:50:19', '1', '1', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/20cfe378c55d45858b548e785850d7b2_%E8%BD%AF%E4%BB%B6%E6%B5%8B%E8%AF%95%E6%8A%80%E6%9C%AF%E7%BB%8F%E5%85%B8%E6%95%99%E7%A8%8B%20%20_%20%202%E7%89%88.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T095027Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=ffb73d314100613b701455e9e51665c115fbee837641e8a80713e394bb0cf460', 1, '2025-01-21 17:50:32', '2025-01-21 17:50:32', 0);
INSERT INTO `quality_inspection` (`id`, `batch_id`, `inspector`, `inspection_time`, `inspection_items`, `results`, `report_url`, `status`, `create_time`, `update_time`, `deleted`) VALUES (4, 1, '健康检测方', '2025-01-21 09:50:19', '1', '1', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/20cfe378c55d45858b548e785850d7b2_%E8%BD%AF%E4%BB%B6%E6%B5%8B%E8%AF%95%E6%8A%80%E6%9C%AF%E7%BB%8F%E5%85%B8%E6%95%99%E7%A8%8B%20%20_%20%202%E7%89%88.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T095027Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=ffb73d314100613b701455e9e51665c115fbee837641e8a80713e394bb0cf460', 1, '2025-01-21 17:50:32', '2025-01-21 17:50:32', 0);
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `role_name` varchar(50) NOT NULL COMMENT '角色名称',
  `role_desc` varchar(200) DEFAULT NULL COMMENT '角色描述',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色表';

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` (`id`, `role_name`, `role_desc`, `create_time`, `update_time`, `deleted`) VALUES (1, '生产方', '原料生产', '2025-01-21 01:13:44', '2025-01-21 01:14:11', 0);
INSERT INTO `role` (`id`, `role_name`, `role_desc`, `create_time`, `update_time`, `deleted`) VALUES (2, '加工方', '产品审批等等', '2025-01-21 01:15:01', '2025-01-21 01:15:01', 0);
COMMIT;

-- ----------------------------
-- Table structure for supplier
-- ----------------------------
DROP TABLE IF EXISTS `supplier`;
CREATE TABLE `supplier` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL COMMENT '供应商名称',
  `address` varchar(200) DEFAULT NULL COMMENT '地址',
  `phone` varchar(20) DEFAULT NULL COMMENT '联系电话',
  `license_image` text COMMENT '营业执照图片',
  `production_license` text COMMENT '生产许可证',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='供应商信息表';

-- ----------------------------
-- Records of supplier
-- ----------------------------
BEGIN;
INSERT INTO `supplier` (`id`, `name`, `address`, `phone`, `license_image`, `production_license`, `create_time`, `update_time`, `deleted`) VALUES (4, 'lujie', '222', '19958533032', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/657a246ea9784dee89e367672f8f871f_bj.JPG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T103438Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=5af167b196c5a46982c79e7c409034738205160fb3ceb7fdc44ba6a83041145a', 'https://objectstorageapi.hzh.sealos.run/pzwdp9do-ticket/599f5085a6384bc0974ab6f63a511cfe_bj.JPG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=pzwdp9do%2F20250121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250121T103441Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=f26e761f37b4f8998334b877b42e1e59306ccf14886c57afa534b7f77052bf1f', '2025-01-21 02:24:24', '2025-01-21 18:35:39', 0);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户名',
  `password` varchar(100) DEFAULT NULL COMMENT '密码',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `role_id` bigint DEFAULT NULL COMMENT '角色ID',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-禁用 1-启用',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：0-否 1-是',
  `phone` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户表';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`id`, `user_name`, `password`, `email`, `role_id`, `status`, `create_time`, `update_time`, `deleted`, `phone`) VALUES (4, 'lujie', 'X6p4X6p4X6p4X6p4X6p4', '3280550159@qq.com', 1, 1, '2025-01-21 02:24:23', '2025-01-21 19:10:45', 0, '19958533032');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
